package com.dtp.core;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author evolution
 * @title: DtpAutoConfiguration
 * @projectName dtp-nacos
 * @description: TODO
 * @date 2022-10-20 14:53
 */
@Configuration
@ConditionalOnProperty(prefix = "dtp",value = "value",havingValue = "true")
@EnableConfigurationProperties({DtpProperties.class})
@Import({DtpImportBeanDefinitions.class,DtpBeanPostProcessor.class})
@ComponentScan("com.dtp.core")
public class DtpAutoConfiguration {
//    @Autowired
//    private Environment environment;


/*    @Bean
    public DtpExecutor dtpExecutor(){
        Integer corePoolSize = Integer.valueOf(environment.getProperty("dtp.core-pool-size"));
        Integer maximumPoolSize = Integer.valueOf(environment.getProperty("dtp.maximum-pool-size"));
        return new DtpExecutor(corePoolSize,maximumPoolSize);

    }
    */
    @Bean
    public NacosListener nacosListener(){
        return new NacosListener();
    }
    
    @Bean
    public DtpMonitor dtpMonitor(){
        return new DtpMonitor();
    }
    
    
    
}
